﻿using System.Linq;
using System.Web.Mvc;
using Inovout.Data.Domain;
using Inovout.Data.Service;
using Inovout.Web.Mvc;
using KuaJing.Portal.Cms.Domain;

namespace KuaJing.Portal.WebPage.Controllers
{
    [AllowAnonymous]
    public class ContentController : RepositoryController<Content>
    {
        protected override void InitializeDataSources()
        {
            base.InitializeDataSources();
            this.AddDataSource(m => m.Category, () => base.GetService<IRepositoryService<Category>>().Query().First(m => m.Parent == null));
        }
        public override System.Web.Mvc.ActionResult Index(QueryCriteria queryCriteria)
        {
            return View(ModelService.Query().AsEnumerable());
        }
        public override ActionResult New()
        {
            return View("Edit",ModelService.FindById(3002));
        }

    }







}